//**************************************************************************************************************
// CLASS: Label
//
// DESCRIPTION
// Declares a class that represents a Label on an assembly language instruction. This class is derived from
// Operand. The Operand class stores a string which is the name of the label, and this class adds an Address
// data member which is the address in memory of the Label.
//
// AUTHOR INFORMATION
// Kevin R. Burger [KRB]
//   
// Mailing Address:
// Computer Science & Engineering
// School of Computing, Informatics, and Decision Systems Engineering
// Arizona State University
// Tempe, AZ 85287-8809
//
// Email: burgerk@asu
// Web:   http://kevin.floorsoup.com
//**************************************************************************************************************
#ifndef LABEL_HPP
#define LABEL_HPP

#include "Operand.hpp"

//==============================================================================================================
// CLASS: Label
//==============================================================================================================
class Label : public Operand {
public:
    //==========================================================================================================
    // PUBLIC FUNCTION MEMBERS:
    //==========================================================================================================

    //---------------------------------------------------------------------------------------------------------
    // Default ctor.
    //---------------------------------------------------------------------------------------------------------
    Label(std::string const& pName = "", Address const pAddress = 0);

    //---------------------------------------------------------------------------------------------------------
    // Copy ctor.
    //---------------------------------------------------------------------------------------------------------
    Label(Label const& pLabel);

    //---------------------------------------------------------------------------------------------------------
    // Dtor.
    //---------------------------------------------------------------------------------------------------------
   ~Label();

    //---------------------------------------------------------------------------------------------------------
    // GetAddress()
    //---------------------------------------------------------------------------------------------------------
    Address const GetAddress() const;

    //---------------------------------------------------------------------------------------------------------
    // GetName()
    //---------------------------------------------------------------------------------------------------------
    std::string GetName()const;

    //---------------------------------------------------------------------------------------------------------
    // operator=()
    //---------------------------------------------------------------------------------------------------------
    Label& operator=(Label const& pLabel);

    //---------------------------------------------------------------------------------------------------------
    // SetAddress()
    //---------------------------------------------------------------------------------------------------------
    void SetAddress(Address const pAddress);

    //---------------------------------------------------------------------------------------------------------
    // SetName()
    //---------------------------------------------------------------------------------------------------------
    void SetName(std::string const& pName);

protected:
    //==========================================================================================================
    // PROTECTED FUNCTION MEMBERS:
    //==========================================================================================================

    //---------------------------------------------------------------------------------------------------------
    // Copy()
    //---------------------------------------------------------------------------------------------------------
    void Copy(Label const& pLabel);

private:
    //==========================================================================================================
    // PRIVATE DATA MEMBERS:
    //==========================================================================================================

    // A Label is a special type of Operand that has an address associated with the Label.
    Address mAddress;

};

#endif
